package com.mapper;

import com.pojo.Account;
import com.pojo.RightClassOne;
import com.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {

    List<Role> showList(Account account);

    Role showRoleMsg(Long id);

    List<Role> bandChileRole(Long id);

    List<RightClassOne> findAllRights();

    List<RightClassOne> findRightsBySuperId(Integer pid);

    RightClassOne findRightsById(Integer pid);

    int deleteRoleById(Integer id);

    /**
     * 模糊查询
     * @param role
     * @return
     */
    List<Role> searchRoleByNameOrStatus(Role role);

    /**
     * 添加商户
     * @param role
     * @return
     */
    int addBusiness(Role role);

    List<Role> superBusinessList();
    /**
     * 修改角色信息
     * @param role
     * @return
     */
    int updateBusiness(Role role);

    List<RightClassOne> findAccountRights(Long id);

    /**
     * 查询所有操作权限
     */
    List<RightClassOne> findAllDoRights();
    /**
     * 查询用户操作权限
     */
    List<RightClassOne> findAccountDoRights(Long roleId);

    int updateBusinessChildsStatus(Role role);

    Role findAddRole(String roleName);

    int addRoleRights(@Param("right") String rights,@Param("roleId") Long addRoleId);

    int deleteRoleRights(Long updateRoleId);
}
